package file;

import java.io.File;
import java.io.IOException;

public class CreateNewFileDemo
{
    // 创建一个新文件
    public static void main(String[] args) throws IOException
    {
        File file = new File("test.txt");
        if (file.exists())
        {
            System.out.println("file is existed");
        }
        else
        {
            file.createNewFile();
            System.out.println("file has created");
        }
    }
}
